<template>
  <div>
   <!-- <van-button type="primary">主要按钮</van-button>
    <van-button type="info">信息按钮</van-button>
    <van-button type="default">默认按钮</van-button>
    <van-button type="warning">警告按钮</van-button>
    <van-button type="danger">危险按钮</van-button>-->

    <van-swipe class="my-swipe" :autoplay="3000" :vertical="true"
               width="100%" height="200"
               indicator-color="red" :show-indicators="false">
      <van-swipe-item>
        <img src="../assets/1.jpg" alt="">
      </van-swipe-item>
      <van-swipe-item>
        <img src="../assets/2.jpg" alt="">
      </van-swipe-item>
      <van-swipe-item>
        <img src="../assets/3.jpg" alt="">
      </van-swipe-item>
      <van-swipe-item>
        <img src="../assets/4.jpg" alt="">
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
  //Button:本身就是一个vue组件的配置项
  import { Button } from 'vant';
  import { Swipe, SwipeItem } from 'vant';
  export default {
    name: 'HelloWorld',
    components:{
      [Button.name]:Button,
      [Swipe.name]:Swipe,
      [SwipeItem.name]:SwipeItem
    },
    mounted(){
      console.log(Swipe.name,SwipeItem.name)
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

  .my-swipe{
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    overflow: hidden;
    background-color: pink;
    height: 200px;
  }
  img{
    width: 100%;
    height: 100%;
  }
</style>
